package com.sghy.xcxservice.dto;

import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

@Data
public class RoomContent {
    /**
     * 附件
     */
    @TableField(value = "files")
    private String files;
    public JSONArray getFiles(){
        if (files==null || "".equals(files)){
            return null;
        }
        return JSONArray.parseArray(files);
    }

    /**
     * 内容
     */
    @NotBlank(message = "内容不可为空")
    @Size(min = 1,max = 5000, message = "内容长度为0-5000")
    private String content;

}
